﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;

public partial class Admin : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        }
    protected void Button1_Click(object sender, EventArgs e)
    {
        SqlConnection conn = new SqlConnection(@"Data Source=HT-PC\SQLEXPRESS;Initial Catalog=ThucTap;Integrated Security=True");
        SqlDataAdapter ad = new SqlDataAdapter(@"select * from tblLogin where username=N'"+TextBox1.Text+"' AND password=N'"+TextBox2.Text+"'",conn);
        DataSet dset = new DataSet();
        ad.Fill(dset, "tblLogin");
        if (dset.Tables[0].Rows.Count != 0)
            Response.Redirect("Edit.aspx");
        else Response.Redirect("Admin.aspx");
        
         
    }
}
